

<!--
  ~ Copyright (c) 2021. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  ~ Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
  ~ Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
  ~ Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
  ~ Vestibulum commodo. Ut rhoncus gravida arcu.
  -->

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<head>
  <meta charset="utf-8">
  <title>layuiAdmin 控制台主页一</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="layuiadmin/style/admin.css" media="all">
</head>
<body>
  
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-row layui-col-space15">
          <div class="layui-col-md6">
            <div class="layui-card">
              <div class="layui-card-header">快捷方式</div>
              <div class="layui-card-body">
                
                <div class="layui-carousel layadmin-carousel layadmin-shortcut">
                  <div carousel-item>
                    <ul class="layui-row layui-col-space10">
                      <li class="layui-col-xs3">
                        <a lay-href="home/homepage1.html">
                          <i class="layui-icon layui-icon-console"></i>
                          <cite>主页一</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="home/homepage2.html">
                          <i class="layui-icon layui-icon-chart"></i>
                          <cite>主页二</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="component/layer/list.html">
                          <i class="layui-icon layui-icon-template-1"></i>
                          <cite>弹层</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a layadmin-event="im">
                          <i class="layui-icon layui-icon-chat"></i>
                          <cite>聊天</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="component/progress/index.html">
                          <i class="layui-icon layui-icon-find-fill"></i>
                          <cite>进度条</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="app/workorder/list.html">
                          <i class="layui-icon layui-icon-survey"></i>
                          <cite>工单</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="user/user/list.html">
                          <i class="layui-icon layui-icon-user"></i>
                          <cite>用户</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="set/system/website.html">
                          <i class="layui-icon layui-icon-set"></i>
                          <cite>设置</cite>
                        </a>
                      </li>
                    </ul>
                  </div>
                </div>
                
              </div>
            </div>
          </div>
          <div class="layui-col-md6">
            <div class="layui-card">
              <div class="layui-card-header">待办事项</div>
              <div class="layui-card-body">

                <div class="layui-carousel layadmin-carousel layadmin-backlog">
                  <div carousel-item>
                    <ul class="layui-row layui-col-space10">
                      <li class="layui-col-xs6">
                        <a lay-href="app/content/comment.html" class="layadmin-backlog-body">
                          <h3>待审评论</h3>
                          <p><cite>66</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a lay-href="app/forum/list.html" class="layadmin-backlog-body">
                          <h3>待审帖子</h3>
                          <p><cite>12</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a lay-href="template/goodslist.html" class="layadmin-backlog-body">
                          <h3>待审商品</h3>
                          <p><cite>99</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a href="javascript;" onclick="layer.tips('不跳转', this, {tips: 3});" class="layadmin-backlog-body">
                          <h3>待发货</h3>
                          <p><cite>20</cite></p>
                        </a>
                      </li>
                    </ul>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="layui-col-md12">
			<div class="layui-card">
			  <div class="layui-card-header">时间查询</div>
              <div class="layui-btn-container">
                <button type="button" class="layui-btn" id="day1">今天</button>
                <button type="button" class="layui-btn" id="day2">昨天</button>
                <button type="button" class="layui-btn" id="day7">7天</button>
                <button type="button" class="layui-btn" id="day14">14天</button>
                <button type="button" class="layui-btn" id="day30">30天</button>
              </div>
              <table class="layui-hide" id="day-console" lay-data="{id: 'day-console'}"></table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <script src="layuiadmin/layui/layui.js?t=1"></script>
  <script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-sm" lay-href="article/listform.html?editid={{d.id}}">编辑</a>
  </script>
  <script>
  layui.config({
    base: 'layuiadmin/' //静态资源所在路径

  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'console','table','setter','admin','form','table','laytpl','element','view'],
          function(){
    var $ = layui.jquery
            ,setter = layui.setter
            ,admin = layui.admin
            ,form = layui.form
            ,table = layui.table
            ,$ = layui.jquery
            ,element = layui.element
            ,laytpl = layui.laytpl
            ,view = layui.view;
    form.render();

    table.render({
      elem: '#day-console'
      ,url:'/getarticlelist'
      ,title: 'day1'
      ,totalRow: true
      ,cellMinWidth: 100 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
      ,cols: [[
        {field:'', title:'文章ID',  fixed: 'left', unresize: true, sort: true ,templet: '<a href="/article/{{d.id}}" target="_blank" class="layui-table-link">{{d.article.id}}</a>'}
        ,{field:'article.title', title:'文章标题', templet: '<a href="/article/{{d.id}}" target="_blank" class="layui-table-link">{{d.article.title}}</a>'}
        ,{field:'', title:'作者' , templet: '<a href="/article/{{d.id}}" target="_blank" class="layui-table-link">{{d.userInfo.nickname}}</a>'}
        ,{field:'', title:'分类' , templet: '<a href="/article/{{d.id}}" target="_blank" class="layui-table-link">{{d.classify.title}}</a>'}
        ,{field:'tags.title', title:'标签' , templet: '<a href="/article/{{d.id}}" target="_blank" class="layui-table-link">{{d.tags.title}}</a>'}
        ,{field:'article.created', title:'创建日期',  templet: '#created'}
        ,{field:'article.status', title:'状态',templet: '#status'}
        ,{field:'article.comment_count', title:'评论数量', templet: '<a href="/article/{{d.id}}" target="_blank" class="layui-table-link">{{d.article.comment_count}}</a>'}
        ,{field:'article.modified', title:'最后修改时间', templet: '#modified'}
        ,{fixed: 'right', title:'操作', toolbar: '#barDemo'}
      ]]
    });

    var btn1 =document.getElementById("day1");
    btn1.addEventListener('click',function(){
      table.reload('day-console', {url: '/getarticlelist?date=1'});
    },false);

    var btn2 =document.getElementById("day2");
    btn2.addEventListener('click',function(){
      table.reload('day-console', {url: '/getarticlelist?date=2'});
    },false);

    var btn7 =document.getElementById("day7");
    btn7.addEventListener('click',function(){
      table.reload('day-console', {url: '/getarticlelist?date=7'});
    },false);

    var btn14 =document.getElementById("day14");
    btn14.addEventListener('click',function(){
      table.reload('day-console', {url: '/getarticlelist?date=14'});
    },false);

    var btn30 =document.getElementById("day30");
    btn30.addEventListener('click',function(){
      table.reload('day-console', {url: '/getarticlelist?date=30'});
    },false);

  });
  </script>
  <script src="/original/js/inttotime.js"></script>

  <script type="text/html" id="created">
    {{#
    var created = date(d.article.created);
    }}
    {{= created}}
  </script>
  <script type="text/html" id="modified">
    {{#
    var modified = date(d.article.modified);
    }}
    {{= modified}}
  </script>
  <script type="text/html" id="status">
    {{#
    var str = " ";
    if(d.article.status=="normal"){str="已发布"}
    else if(d.article.status=="draft"){str="草稿箱"}
    else if(d.article.status=="trash"){str="垃圾箱"}
    }} {{= str }}
  </script>
</body>
</html>

